import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-search',
  templateUrl: './search.component.html',
  styleUrls: ['./search.component.scss']
})
export class SearchComponent implements OnInit {

  public keywords: string
  public historyList: any[] = [

  ]
  constructor() { }

  ngOnInit(): void {
  }
  doSearch() {
    if (!this.historyList.includes(this.keywords)) {
      this.historyList.push(this.keywords)
    }
    this.keywords = ''
  }
  deleteHistory(key) {
    this.historyList.splice(key, 1)
  }
}
